package cate.game.train.furniture.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTrain;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "保存洗练结果 的请求")
public class FurnitureSaveReq implements MsgInput {
    @NoteField("手办uid")
    public String uid;
    @NoteField("食灵uid")
    public String heroUid;
    @NoteField("位置")
    public byte pos;
    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = game.train.furniture.save(cc.getRole(), uid, heroUid, pos);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTrain.FURNITURE_SAVE_REQ;
    }
}
